<{include file="public_html/header.html"}>
<{include file="public_html/left_menu.html"}>
	<!-- content starts -->
	<blockquote class="layui-elem-quote"><{$action}></blockquote>

	<fieldset class="layui-elem-field">
		<legend>按条件搜索</legend>
		<div class="layui-field-box">
			<form class="layui-form layui-form-pane1" method="post" action="<{$current_url}>">
				<div class="layui-form-item">
				<div class="layui-inline">
						<select name="subject">
						<option value="0">请选择科目</option>
						<{foreach from=$category_list item=item}>
						<option value="<{$item['id']}>" <{if $conditions['subject']>0}>selected<{/if}>><{$item['name']}></option>
						<{/foreach}>
						</select>
					</div>
					<div class="layui-inline">
						<input type="text" name="title" placeholder="课本名称" value="<{if !empty($conditions['title']) }><{$conditions['title']}><{/if}>" class="layui-input">
					</div>
					
					<div class="layui-inline">
						<button type="submit" class="layui-btn">搜索</button>
						<a class="layui-btn" href="/subject_book/add"><i class="layui-icon"></i> 添加课本</a>
					</div>
				</div>
			</form>
		</div>
	</fieldset>
	<form class="layui-form layui-form-pane1" method="post" delete_action="/subject_book/delete">
		<table class="layui-table" lay-even lay-skin="row">
			<thead>
				<tr>
					<th>课本名称</th>
					<th>科目</th>
					<th>年级</th>
					<th>上下册</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
			<{foreach from=$subject_list item=item}>
					<td class="center"><a style="font-weight: bold;" href="/subject_book/chapter_list/<{$item.id}>"><{$item['title']}></a></td>

					<td><{$item['subject_name']}></td>
					<td><{$item['grade']}>年级</td>
					<td>
					<{if $item['semester']==1}>
					上册
					<{elseif $item['semester']==2}>
					下册
					<{/if}>
					</td>
					<td class="center">
						<a class="layui-btn layui-btn-primary layui-btn-small" href="/subject_book/edit/<{$item['id']}>" target="_blank"><i class="layui-icon"></i></a>

						<a class="layui-btn layui-btn-primary layui-btn-small delete_data" href="/subject_book/delete/<{$item['id']}>"><i class="layui-icon"></i></a>

						<a class="layui-btn layui-btn-primary layui-btn-small" href="/subject_book/index_chapter/<{$item['id']}>" ><i class="layui-icon">章节管理</i></a>

					</td>
				</tr>
			<{/foreach}>
			<{if $subject_list|count eq 0}>
				<tr>
					<td class="center" style=" height:120px; text-align:center;line-height:120px;" colspan="8">
						赞无数据！
					</td>
				</tr>
			<{/if}>
			<!-- <tr>
				<td class="center" colspan="4">
					<input type="checkbox" lay-filter="checkbox_all" title="全选">
					<button id="delete" class="layui-btn layui-btn-primary layui-btn-small" style="margin-top:4px;"><i class="layui-icon"></i> 批量删除</button>
				</td>
			</tr> -->
			</tbody>
		</table>
	</form>
	<div class="layui-box layui-laypage layui-laypage-default">
		<{$pagination}>
	</div>
<{include file="public_html/footer.html"}>
